using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FerrScript.Builder
{
    public class SetVariableBlock : BuilderBlock
    {
        #region Fields
        string varName;
        string initialValue;
        #endregion

        #region Properties
        public string VarName
        {
            get { return varName; }
            set { varName = value; }
        }
        public string Value
        {
            get { return initialValue; }
            set { initialValue = value; }
        }
        #endregion

        #region Constructor
        public SetVariableBlock()
            : this("", "") { }
        public SetVariableBlock(string aVarName, string aInitialValue)
        {
            varName      = aVarName;
            initialValue = aInitialValue;
        }
        #endregion

        #region Overrides
        public override string ToString()
        {
            return "(set " + varName + " " + initialValue + ")";
        }
        #endregion

        #region Abstract overrides
        public override string BlockName
        {
            get { return "Set Var"; }
        }
        public override ParenType ParenType
        {
            get { return ParenType.SelfContained; }
        }
        public override BlockType BlockType
        {
            get { return BlockType.Variable; }
        }
        public override string Description
        {
            get { return varName + " = " + initialValue; }
        }
        public override string IconName
        {
            get { return "Command.png"; }
        }
        #endregion
    }
}